/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Arrays;
import java.util.Date;

/**
 * <p>Project: app2022 - Arr6
 * <p>Powered by webrx On 2022-01-10 09:37:42
 *
* @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Arr6 {
    public static void main(String[] args) {
        int[] s = new int[6];
        System.out.println(s[0]); //0
        Arrays.fill(s, 1, 3, 5); //1-2 填充5
        System.out.println(Arrays.toString(s));

        //任意类型的数组元素
        Object[] objs = new Object[]{"ok", true, 10, .5, new Date()};
        for (Object o : objs) {
            if (o instanceof Date) {
                System.out.printf("%tF %<tT%n", o);
            } else {
                System.out.println(o);
            }
        }

        var n = new int[3][6];
        System.out.println(n.length);
        System.out.println(Arrays.deepToString(n));
        for (int[] i : n) {
            for (int j : i) {
                System.out.printf("%d ", j);
            }
            System.out.println();
        }
    }
}
